package com.potenza.training.resume.controller;

import com.potenza.training.resume.entity.ResumePersonalSkills;
import com.potenza.training.resume.service.ResumePersonalSkillsService;
import io.renren.common.utils.R;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("resume/skills")
public class ResumePersonalSkillsController {

    @Autowired
    private ResumePersonalSkillsService resumePersonalSkillsService;

    /**
     * 保存
     */
    @RequestMapping("/save")
    @RequiresPermissions("resume:skills:save")
    public R save(@RequestBody Map<String,Object> requestMap){
        resumePersonalSkillsService.saveResumePersonalSkills(requestMap);

        return R.ok();
    }

    /**
     * 列表
     */
    @RequestMapping("/list/{userId}")
    @RequiresPermissions("resume:skills:list")
    public R list(@PathVariable Integer userId){
        List<ResumePersonalSkills> list = resumePersonalSkillsService.findAll(userId);

        return R.ok().put("data", list);
    }

//    /**
//     * 修改
//     */
//    @RequestMapping("/update")
//    @RequiresPermissions("resume:status:update")
//    public R update(@RequestBody ResumeHopeStatus resumeHopeStatus){
//        resumeHopeStatusService.updateResumeHopeStatus(resumeHopeStatus);
//
//        return R.ok();
//    }

}
